JBoss Community Archive (Read Only)

Portlet Bridge 3.1

Resource Serving

When using resources from your JSF portlet it's important to ensure that they are accessed in a way that allows the JBoss Portlet Bridge to generate an appropriate Portal URL to the resource being requested.

Using JSF 2 tags to access resources, such as <h:outputScript>, <h:outputStylesheet>, <h:graphicImage> and <h:link> all use JSF 2 mechanisms for generating the URL, and so should generate appropriate Portal URLs.

However, in some situations it may not be possible to use any of the above tags, such as image urls within css files, importing a css file from another, etc. In these situations the correct way to reference a resource is to place it within the resources folder of your web application so that the resource can be retrieved using JSF 2 Resource Handling such as:

#{resource['/stylesheet.css']}

stylesheet.css would be present in the root of the resources folder as it does not specify a resource library

Use of #{resource} to retrieve the content is especially important for @import within css files.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 12:27:01 UTC, last content change 2012-11-02 15:49:32 UTC.